package com.nbsaas.boot.manufacturing.rest.resource;

import com.nbsaas.boot.manufacturing.api.apis.ProcessRouteApi;
import com.nbsaas.boot.manufacturing.data.entity.ProcessRoute;
import com.nbsaas.boot.manufacturing.api.domain.request.ProcessRouteRequest;
import com.nbsaas.boot.manufacturing.api.domain.response.ProcessRouteResponse;
import com.nbsaas.boot.manufacturing.api.domain.simple.ProcessRouteSimple;
import com.nbsaas.boot.manufacturing.rest.convert.ProcessRouteSimpleConvert;
import com.nbsaas.boot.manufacturing.rest.convert.ProcessRouteEntityConvert;
import com.nbsaas.boot.manufacturing.rest.convert.ProcessRouteResponseConvert;
import com.nbsaas.boot.manufacturing.data.repository.ProcessRouteRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import jakarta.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   工艺路线-业务接口实现
*/
@Transactional
@Service
public class ProcessRouteResource extends BaseResource<ProcessRoute,ProcessRouteResponse, ProcessRouteSimple, ProcessRouteRequest>  implements ProcessRouteApi {

    @Resource
    private ProcessRouteRepository processRouteRepository;

    @Override
    public JpaRepositoryImplementation<ProcessRoute, Serializable> getJpaRepository() {
        return processRouteRepository;
    }

    @Override
    public Function<ProcessRoute, ProcessRouteSimple> getConvertSimple() {
        return new ProcessRouteSimpleConvert();
    }

    @Override
    public Function<ProcessRouteRequest, ProcessRoute> getConvertForm() {
        return new ProcessRouteEntityConvert();
    }

    @Override
    public Function<ProcessRoute, ProcessRouteResponse> getConvertResponse() {
        return new ProcessRouteResponseConvert();
    }




}


